package com.ruoyi.system.dto.convert;

import com.ruoyi.system.domain.Design;
import com.ruoyi.system.dto.design.DesignDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 * 设计转换接口
 */
@Mapper
public interface DesignConvert {

    DesignConvert INSTANCE = Mappers.getMapper(DesignConvert.class);

    /**
     * 转换实体为DTO
     * @param entity 实体
     * @return DTO
     */
    @Mapping(target = "createdTime", ignore = true)
    @Mapping(target = "updatedTime", ignore = true)
    DesignDTO convert(Design entity);

    /**
     * 转换DTO为实体
     * @param dto DTO
     * @return 实体
     */
    @Mapping(target = "createdTime", ignore = true)
    @Mapping(target = "updatedTime", ignore = true)
    Design convert(DesignDTO dto);
}
